package com.hk.core.authentication.security.session;

import com.hk.core.web.Webs;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.web.session.InvalidSessionStrategy;



/**
 * @author Kevin
 */
public record JsonInvalidSessionStrategy(Object data) implements InvalidSessionStrategy {

    @Override
    public void onInvalidSessionDetected(HttpServletRequest request, HttpServletResponse response) {
        Webs.writeJson(response, HttpServletResponse.SC_OK, data);
    }
}
